package yxj02;

import java.io.*;

public class CopyJavaDemo {
    public static void main(String[] args) throws IOException {
/*        //根据数据源创建字符输入流对象
        BufferedReader br = new BufferedReader(new FileReader("D:\\Ccode\\java-se\\IOStream\\src\\yxj02\\PrintStreamDemo.java"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\Ccode\\java-se\\IOStream\\src\\Copy.txt"));
        //读写数据
        String line;
        while((line=br.readLine()) != null) {
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        br.close();
        bw.close();*/

        BufferedReader br = new BufferedReader(new FileReader("D:\\Ccode\\java-se\\IOStream\\src\\yxj02\\PrintStreamDemo.java"));
        PrintWriter pw = new PrintWriter(new FileWriter("D:\\Ccode\\java-se\\IOStream\\src\\Copy.java"),true);
        String line;
        while((line=br.readLine()) != null) {
            pw.println(line);
        }
        pw.close();
        br.close();
    }
}
